package com.zsq.thread.test2;

/**
 * @author : zhang sq
 * @date : 2019/12/25 21:36
 **/
//同步锁 关键字 synchronized
public class Sync2 {
    private int count = 10;
    private Object object = new Object();

    private synchronized void method() {
        count--;
        System.out.println(Thread.currentThread().getName() + "count=" + count);
    }
}
